/**
 * Created by Qingger Corp.
 * User: jsspf
 * Date: 2018/1/2
 * Time: 16:29
 */

import {Context} from "koa";


function log(ctx:Context) {
   console.info('========> There is a Request:',ctx.method,ctx.headers.host+ctx.url);
}

/**
 *
 * @return {(ctx: Application.Context, next: Function) => Promise<any>}
 */
export function midLogger() {
   return async function (ctx:Context,next:Function) {
      log(ctx);
      await next();
   }
}
